import React from 'react';
import ModuleNavOneLine from './ModuleNavOneLine';
import ModuleNavTwoLine from './ModuleNavTwoLine';

const NavStyle = {
  one: 1,
  two: 2,
};

const components = {
  [NavStyle.one]: ModuleNavOneLine,
  [NavStyle.two]: ModuleNavTwoLine,
};

const ModuleNav = ({ componentCfg: { styleSettingRender, content,styleSetting } = {} }) => {
  const params = {
    navList: content?.items ?? [],
    styleSettingRender,
    styleSetting
  };

  const CustomTag = components[styleSettingRender.style];

  if (!CustomTag) {
    return null;
  }

  return <CustomTag {...params} />;
};

export default ModuleNav;
